package com.punai.dataanalysis.cblib.controller;

import com.punai.common.core.controller.BaseController;
import com.punai.common.core.domain.AjaxResult;
import com.punai.common.core.domain.TreeBo;
import com.punai.common.core.page.TableDataInfo;
import com.punai.dataanalysis.cblib.bo.CompareBo;
import com.punai.dataanalysis.cblib.bo.FeepriceAndMMABo;
import com.punai.dataanalysis.cblib.service.FeePriceLibService;
import com.punai.dataanalysis.cblib.vo.FeeChapterTreeVo;
import com.punai.dataanalysis.cblib.vo.FeeListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/cblib/feepricelib/lwfee")
public class FeePriceLibController extends BaseController {

    @Autowired
    private FeePriceLibService feePriceLibService;



    // 获取标准/成本费用项树组合
    @GetMapping("/getTreeData")
    public AjaxResult getFeeChapter(FeeChapterTreeVo vo) {
        List<TreeBo> treeBos = feePriceLibService.selectTreeData(vo);
        return AjaxResult.success(treeBos);
    }

    @GetMapping("/getFeeList")
    public TableDataInfo getFeeList(FeeListVo vo) {
        TableDataInfo tableDataInfo = feePriceLibService.selectFeeList(vo);
        return tableDataInfo;
    }


    @PreAuthorize("@ss.hasPermi('dataanalysis:cblib:wzclfeedetail')")
    @GetMapping("/getFeeDetailList")
    public AjaxResult getFeeDetailList(FeeListVo vo) {
        FeepriceAndMMABo res = feePriceLibService.getFeeDetailList(vo);
        return AjaxResult.success(res);
    }

    @PreAuthorize("@ss.hasPermi('dataanalysis:cblib:wzclfeecompare')")
    @GetMapping("/getFeeCompareList")
    public AjaxResult getCompareList(FeeListVo vo) {
        CompareBo res = feePriceLibService.getFeeCompareList(vo);
        return AjaxResult.success(res);
    }


}
